<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$router->get('/', function () use ($router) {
    //return $router->app->version();
    return redirect('/map');
});


//地图API
$router->group(['prefix'=>'/api/map', 'namespace'=>'Map'], function () use ($router) {
    $router->post('dologin', 'LoginController@dologin');
    //货物字典
    $router->post('hwzd/index', 'HwzdController@index');
    $router->post('hwzd/modify', 'HwzdController@modify');
    $router->post('hwzd/del', 'HwzdController@del');
    //货架
    $router->post('shelf/index', 'ShelfController@index');
    $router->post('shelf/add', 'ShelfController@add');
    $router->post('shelf/modify', 'ShelfController@modify');
    //层
    $router->post('ceng/index', 'CangweiController@getCengList');
    $router->post('ceng/modify', 'CangweiController@cengModify');
    $router->post('cangwei/modify', 'CangweiController@modify');
    $router->post('cangwei/del', 'CangweiController@del');
    //货物仓位
    $router->post('hwcw/index', 'HwcwController@index');
    $router->post('hwcw/option', 'HwcwController@getOption');
    $router->post('hwcw/one', 'HwcwController@getOne');
    $router->post('hwcw/cang-in', 'HwcwController@cangIn');
    $router->post('hwcw/cang-decre', 'HwcwController@cangDecre');
    $router->post('hwcw/cang-incre', 'HwcwController@cangIncre');
    //货物搜索
    $router->post('hwss/hwbykey', 'HwssController@hwByKey');
    $router->post('hwss/cwList', 'HwssController@cwList');
    $router->post('hwss/hwList', 'HwssController@hwList');
});


//APP的API
$router->group(['prefix'=>'/api/app', 'namespace'=>'ApiApp'], function () use ($router) {
    // $router->post('dologin', 'LoginController@dologin');
    //地图
    $router->get('map/index', 'MapController@index');
});


$router->get('dy/sousuo', 'DyController@sousuo');